/**
 * Copyright (C), 2015-2019, XXX有限公司
 * FileName: HolidayBuilder
 * Author:   zhouheng
 * Date:     2019/5/1 13:52
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.zhouh.patterns.com.zhouh.create.builder;

import com.zhouh.patterns.com.zhouh.entity.fruit.Apple;
import com.zhouh.patterns.com.zhouh.entity.fruit.Banana;
import com.zhouh.patterns.com.zhouh.entity.fruit.Orange;

/**
 * 〈一句话功能简述〉<br> 
 * 〈节假日〉
 *
 * @author zhouheng
 * @create 2019/5/1
 * @since 1.0.0
 */
public class HolidayBuilder implements Builder{
    private FruitMeal fruitMeal = new FruitMeal();

    @Override
    public void buildApple(int price) {
        Apple apple = new Apple();
        apple.setPrice(price);
        fruitMeal.setApple(apple);
    }

    @Override
    public void buildBanana(int price) {
        Banana banana = new Banana();
        banana.setPrice(price);
        fruitMeal.setBanana(banana);
    }

    @Override
    public void buildOrange(int price) {
        Orange orange = new Orange();
        orange.setPrice(price);
        fruitMeal.setOrange(orange);
    }

    @Override
    public FruitMeal getFruitMeal() {
        fruitMeal.setDiscount(40);
        fruitMeal.init();

        return fruitMeal;
    }
}